﻿//------------------------------------------------------------------------------------------------- 
// <copyright file="CamlHelper.cs" company="Collaboris">
// Copyright (c) Collaboris.  All rights reserved.
// </copyright>
// <summary>Defines a set of Static Methods to aid with CAML development.</summary>
//-------------------------------------------------------------------------------------------------
namespace Collaboris.Utils
{
    using System.Xml;

    public class CamlHelper
    {
        /// <summary>
        /// Creates NameSpaces necessary to query against
        /// Xml Documents based on the CAML.
        /// </summary>
        /// <returns></returns>
        public static XmlNamespaceManager CreateCAMLNameSpaceMgr(XmlDocument doc)
        {
            ValidationHelper.VerifyObjectArgument(doc, "doc");
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
            nsmgr.AddNamespace("CAML", "http://schemas.microsoft.com/sharepoint/");
            return nsmgr;
        }
    }
}
